#ifndef STRUCTURE_AMOVA_H
#define STRUCTURE_AMOVA_H

#include <gsl/gsl_blas.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>

#include "analysis_base.h"
#include "matrixOps.h"

class StructureAMOVA : public AnalysisBase {

public:
    StructureAMOVA( DataSet *theData );

    bool run();

    gsl_matrix* getHMatrix( QString stratum );
    gsl_matrix* getDistanceMatrix();
    gsl_matrix* getCovarianceMatrix();

    void setPopulationPartition( QString stratum );

private:
    gsl_matrix *H;
    gsl_matrix *D;
    qreal sst,ssr,ssa,ssw;
    qreal dft,dfr,dfa,dfw;
    void createDistanceMatrix();
    void createCovarianceMatrix();
    void createHMatrix( QString stratum );



};

#endif // STRUCTURE_AMOVA_H
